package homework;

public class Test {
	public static void main(String[] args) {
		int count = 0;
		int[] arr = {3,5,9,8,9,6,2,9}; 
		for (int i = 0; i < arr.length-1; i++) {
			if (arr[arr.length-1] == arr[i]) {
				System.out.println(arr[i]);
				count++;
			}
		}
		System.out.println(count);
		
	}

}
